﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WF_PrimeNum
{  

    internal static class Program
    {
        public static int max;
        public static int min;
        public static string getPrime(int max,int min)
        {
            if(min>max||min<0) return string.Empty;
            bool isPrime;
            string result=string.Empty;
            int count = 1;
            for(int i=min; i<=max; i++)
            {
                isPrime = true;
                //判断每个数是否为素数
                for(int j=2;j<i; j++)
                {
                    if (i == 2)
                        break;
                    if (i % j == 0)
                    {
                        isPrime = false;
                        break;
                    }
                }
                if (isPrime)
                {
                    result = result + Convert.ToString(i) + " ";
                    if (count % 10 == 0&&count!=0)
                        result += Environment.NewLine;
                    count++;
                }
            }
            return result;
        }
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}
